<?php
//echo "name:".$_GET["name"];
//echo "POST:".$_POST["name"];
if($_POST["name"]) {
	$rs = [
		"success"=>true,
		"message"=>"成功",
		"name"=> $_POST["name"]
	];
	echo json_encode($rs);
	die();
}
?>
<form method="post">
<input name="nick" />
<input type="submit" value="提交" />
</form>
<script src="static/jquery.js"></script>
<script>
function doAjax(){
	$.ajax({
		url: "/index.php",
		method: "post",
		data: "name=yyyy&k=bbbb",
		success:function(msg) {
			var retData = JSON.parse(msg);
			if(retData.success){
				alert(retData.name)
			}else alert(retData.message)
		}
	})
}
</script>
<input type="button" onclick="doAjax()" value="ajax"/>
